package cn.whitecao.contentcenter.feignclient;

import cn.whitecao.contentcenter.config.FeignLogsConfiguration;
import cn.whitecao.contentcenter.domain.dto.user.UserDTO;
import cn.whitecao.contentcenter.feignclient.fallback.UserCenterFeignClientFallback;
import cn.whitecao.contentcenter.feignclient.fallbackfactory.UserCenterFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author ：腼腆的老黄.
 * @date ：Created in 2019-08-15 17:25
 */
@FeignClient(name = "user-center",fallbackFactory = UserCenterFeignClientFallbackFactory.class )
//@FeignClient(name = "user-center",configuration = FeignLogsConfiguration.class)
public interface UserCenterFeignClient {

    @GetMapping("/users/{id}")
    UserDTO findById(@PathVariable Integer id);

    @GetMapping("/users/q")
    UserDTO query(@SpringQueryMap UserDTO userDTO);
}
